<!DOCTYPE html>
<html><head>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <script>
            window.onload = function()
            {
                document.forms['form'].elements['a1'].focus();

                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }


                var y1 = cargaContextoCanvas('grafica');
                if(y1)
                {
                    y1.beginPath();
                    //Primero vamos a pintar los ejes:
                    //Primero ponemos el color en rojo: 
                    y1.fillStyle = '#cc0000';
                    //Eje de las X: 
                    y1.fillRect(50, 500, 600, 1);
                    //Eje de las Y: 
                    y1.fillRect(50, 0, 1, 500);
                    //Volvemos a poner el color en negro:
                    y1.fillStyle = '#000000';
           
                }	
                var canvas = document.getElementById('grafica');
                canvas.addEventListener('mousemove', function(evt){
                    var mousePos = getMousePos(canvas, evt);
                    var message = "(x,y): " + mousePos.x + "," + mousePos.y;
                    writeMessage(canvas, message);
                    
                }, false);
            }
	

            function showFillText() {
                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }
                var canvas = cargaContextoCanvas('grafica');
                var messagetxt = "d+ (pi)   >=" ;
                var message1txt = "d- (ni)  <=" ;
                canvas.fillStyle = '#f00';
                canvas.font = 'italic bold 15px sans-serif';
                canvas.textBaseline = 'bottom';
                canvas.fillText(messagetxt, 50, 90);
                canvas.fillText(message1txt, 50, 230);
                canvas.fillStyle = '#00cc00';
                canvas.fillText(messagetxt, 550, 200);
                canvas.fillText(message1txt, 550, 230);
                canvas.fillStyle = '#FFFF00';
                canvas.fillText(messagetxt, 150, 480);
                canvas.fillText(message1txt, 50, 430);
            }

            function graficar(form) {

                var a1=parseFloat(form.a1.value);
                var b1=parseFloat(form.b1.value);
                var c1=parseFloat(form.c1.value);
                var a2=parseFloat(form.a2.value);
                var b2=parseFloat(form.b2.value);
                var c2=parseFloat(form.c2.value);
                var a3=parseFloat(form.a3.value);
                var b3=parseFloat(form.b3.value);
                var c3=parseFloat(form.c3.value);
                var a4=parseFloat(form.a4.value);
                var b4=parseFloat(form.b4.value);
                var c4=parseFloat(form.c4.value);
                var a5=parseFloat(form.a5.value);
                var b5=parseFloat(form.b5.value);
                var c5=parseFloat(form.c5.value);
                var a6=parseFloat(form.a6.value);
                var b6=parseFloat(form.b6.value);
                var c6=parseFloat(form.c6.value);
                var horizontal;


                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }
                var linea1 = cargaContextoCanvas('grafica');
                if(linea1)
                {
                    linea1.beginPath();
                    //Primero vamos a pintar los ejes:
                    //Primero ponemos el color en rojo: 
                    linea1.fillStyle = '#000000';
                    //Eje de las X: 

                    for(i=0;i<501;i++)
                    {
                        linea1.fillStyle = '#FFFF00'
                        linea1.fillRect((-i*(b1/a1))+50+(c1/a1), 500-i, 1, 2);
                        linea1.fillStyle = '#0000F8';
                        linea1.fillRect((-i*(b2/a2))+50+(c2/a2), 500-i, 1, 2);
                        linea1.fillStyle = '#993300';
                        linea1.fillRect((-i*(b3/a3))+50+(c3/a3), 500-i, 1, 2);

                    }

                    if (a1==0)
                    {
                        horizontal=c1/b1;
                        form.y1y.value=horizontal;

                        linea1.fillStyle = '#FFFF00';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x1x.value=c1/a1;
                    }


                    if (a2==0)
                    {
                        horizontal=c2/b2;
                        form.y2y.value=horizontal;
                        linea1.fillStyle = '#0000F8';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x2x.value=c2/a2;
                    }

                    if (a3==0)
                    {
                        horizontal=c3/b3;
                        form.y3y.value=horizontal;
                        linea1.fillStyle = '#993300';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x3x.value=c3/a3;
                    }

                }


            }


            function Message(canvas, message){
                var context =canvas.getContext('2d');
                context.clearRect(290, 0, 40, 45);
                context.font = '35pt Calibri';
                context.fillStyle = 'black';
                context.fillText(message,  30, 25);
                context.fillStyle = '#6666ff';
            }

            function writeMessage(canvas, message){
                var context =canvas.getContext('2d');
                context.clearRect(170, 570, 300, 750);
                context.font = '18pt Calibri';
                context.fillStyle = 'black';
                context.fillText(message, 270, 600);
                context.fillStyle = '#6666ff';
		
            }

            
            function getMousePos(canvas, evt){
                // get canvas position
                var obj = canvas;
                var top = 0;
                var left = 0;
                while (obj && obj.tagName != 'BODY') {
                    top += obj.offsetTop;
                    left += obj.offsetLeft;
                    obj = obj.offsetParent;
                }
                
                // return relative mouse position
                var mouseX = evt.clientX - left -50 + window.pageXOffset;
                var mouseY = evt.clientY - top -500 + window.pageYOffset;
                return {
                    x: mouseX,
                    y: -mouseY
                };
            }

            function modelar(form) {
                form.a1.value=form.p1mp1.value;
                form.b1.value=form.p2mp1.value;
                form.c1.value=form.dispmp1.value;
                form.a2.value=form.p1mp2.value;
                form.b2.value=form.p2mp2.value;
                form.c2.value=form.dispmp2.value;
                form.a3.value=form.p1mp3.value;
                form.b3.value=form.p2mp3.value;
                form.c3.value=form.dispmp3.value;

            }


            function modelarmetas(form) {
                form.a4.value=form.g1.value;
                form.b4.value=form.g2.value;
                form.c4.value=form.gmin.value;
                var cant=parseFloat(form.cantidad2.value);
                form.a5.value=1;
                form.b5.value=cant*-1;
                form.c5.value=0;
                form.a6.value=0;
                form.b6.value=1;
                form.c6.value=form.p2min.value;



            }


            function meta1(form) {
                form.a4.value=form.g1.value;
                form.b4.value=form.g2.value;
                form.c4.value=form.gmin.value;


            }

            function meta2(form) {
                var cant=parseFloat(form.cantidad2.value);
                form.a5.value=1;
                form.b5.value=cant*-1;
                form.c5.value=0;

            }

            function meta3(form) {

                form.a6.value=0;
                form.b6.value=1;
                form.c6.value=form.p2min.value;

            }

            function metas(form) {

                var a1=parseFloat(form.a1.value);
                var b1=parseFloat(form.b1.value);
                var c1=parseFloat(form.c1.value);
                var a2=parseFloat(form.a2.value);
                var b2=parseFloat(form.b2.value);
                var c2=parseFloat(form.c2.value);
                var a3=parseFloat(form.a3.value);
                var b3=parseFloat(form.b3.value);
                var c3=parseFloat(form.c3.value);
                var a4=parseFloat(form.a4.value);
                var b4=parseFloat(form.b4.value);
                var c4=parseFloat(form.c4.value);
                var a5=parseFloat(form.a5.value);
                var b5=parseFloat(form.b5.value);
                var c5=parseFloat(form.c5.value);
                var a6=parseFloat(form.a6.value);
                var b6=parseFloat(form.b6.value);
                var c6=parseFloat(form.c6.value);
                var horizontal;


                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }
                var linea1 = cargaContextoCanvas('grafica');
                if(linea1)
                {
                    linea1.beginPath();
                    //Ejes:
                    //Color rojo: 
                    linea1.fillStyle = '#000000';
                    //Eje de las X: 

                    for(i=0;i<501;i++)
                    {

                        linea1.fillStyle = '#FF0000';
                        linea1.fillRect((-i*(b4/a4))+50+(c4/a4), 500-i, 2, 2);
                        linea1.fillStyle = '#FF9900';
                        linea1.fillRect((-i*(b5/a5))+50+(c5/a5), 500-i, 2, 2);
                        linea1.fillStyle = '#33CC00';
                        linea1.fillRect((-i*(b6/a6))+50+(c6/a6), 500-i, 2, 2);
                    }

                    if (a4==0)
                    {
                        horizontal=c4/b4;
                        form.y4y.value=horizontal;
                        linea1.fillStyle = '#FF0000';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x4x.value=c4/a4;
                    }

                    if (a5==0)
                    {
                        horizontal=c5/b5;
                        form.y5y.value=horizontal;
                        linea1.fillStyle = '#FF9900';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x5x.value=c5/a5;
                    }
                    if (a6==0)
                    {
                        horizontal=c6/b6;
                        form.y6y.value=horizontal;
                        linea1.fillStyle = '#33CC00';
                        linea1.fillRect(50, 500-horizontal, 600, 2);
                    }
                    else
                    {
                        form.x6x.value=c6/a6;
                    }

                }


            }

            function puntointerseccion(form) {
                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }
                var facline = cargaContextoCanvas('grafica');

                var a1=parseFloat(form.a1.value);
                var b1=parseFloat(form.b1.value);
                var c1=parseFloat(form.c1.value);
                var a2=parseFloat(form.a2.value);
                var b2=parseFloat(form.b2.value);
                var c2=parseFloat(form.c2.value);
                var a3=parseFloat(form.a3.value);
                var b3=parseFloat(form.b3.value);
                var c3=parseFloat(form.c3.value);
                var a4=parseFloat(form.a4.value);
                var b4=parseFloat(form.b4.value);
                var c4=parseFloat(form.c4.value);
                var a5=parseFloat(form.a5.value);
                var b5=parseFloat(form.b5.value);
                var c5=parseFloat(form.c5.value);
                var a6=parseFloat(form.a6.value);
                var b6=parseFloat(form.b6.value);
                var c6=parseFloat(form.c6.value);


                if(a1==0)
                {
                    var x12=((a2*c1)-(a1*c2))/((a2*b1)-(a1*b2));
                    var y12=((c2-(b2*x12))/a2);
                    var x13=((a3*c1)-(a1*c3))/((a3*b1)-(a1*b3));
                    var y13=((c3-(b3*x13))/a3);
                    var x14=((a4*c1)-(a1*c4))/((a4*b1)-(a1*b4));
                    var y14=((c4-(b4*x14))/a4);
                    var x15=((a5*c1)-(a1*c5))/((a5*b1)-(a1*b5));
                    var y15=((c5-(b5*x15))/a5);
                    var x16=((a6*c1)-(a1*c6))/((a6*b1)-(a1*b6));
                    var y16=((c6-(b6*x16))/a6);
                }
                else
                {
                    var x12=((a1*c2)-(a2*c1))/((a1*b2)-(a2*b1));
                    var y12=((c1-(b1*x12))/a1);

                    var x13=((a1*c3)-(a3*c1))/((a1*b3)-(a3*b1));
                    var y13=((c1-(b1*x13))/a1);

                    var x14=((a1*c4)-(a4*c1))/((a1*b4)-(a4*b1));
                    var y14=((c1-(b1*x14))/a1);

                    var x15=((a1*c5)-(a5*c1))/((a1*b5)-(a5*b1));
                    var y15=((c1-(b1*x15))/a1);

                    var x16=((a1*c6)-(a6*c1))/((a1*b6)-(a6*b1));
                    var y16=((c1-(b1*x16))/a1);
                }


                if(a2==0)
                {
                    var x23=((a3*c2)-(a2*c3))/((a3*b2)-(a2*b3));
                    var y23=((c3-(b3*x23))/a3);
                    var x24=((a4*c2)-(a2*c4))/((a4*b2)-(a2*b4));
                    var y24=((c4-(b4*x24))/a4);
                    var x25=((a5*c2)-(a2*c5))/((a5*b2)-(a2*b5));
                    var y25=((c5-(b5*x25))/a5);
                    var x26=((a6*c2)-(a2*c6))/((a6*b2)-(a2*b6));
                    var y26=((c6-(b6*x26))/a6);

                }
                else
                {
                    var x23=((a2*c3)-(a3*c2))/((a2*b3)-(a3*b2));
                    var y23=((c2-(b2*x23))/a2);


                    var x24=((a2*c4)-(a4*c2))/((a2*b4)-(a4*b2));
                    var y24=((c2-(b2*x24))/a2);

                    var x25=((a2*c5)-(a5*c2))/((a2*b5)-(a5*b2));
                    var y25=((c2-(b2*x25))/a2);

                    var x26=((a2*c6)-(a6*c2))/((a2*b6)-(a6*b2));
                    var y26=((c2-(b2*x26))/a2);

                }

                if(a3==0){

                    var x34=((a4*c3)-(a3*c4))/((a4*b3)-(a3*b4));
                    var y34=((c4-(b4*x34))/a4);
                    var x35=((a5*c3)-(a3*c5))/((a5*b3)-(a3*b5));
                    var y35=((c5-(b5*x35))/a5);
                    var x36=((a6*c3)-(a3*c6))/((a6*b3)-(a3*b6));
                    var y36=((c6-(b6*x36))/a6);

                }
                else
                {

                    var x34=((a3*c4)-(a4*c3))/((a3*b4)-(a4*b3));
                    var y34=((c3-(b3*x34))/a3);
                    var x35=((a3*c5)-(a5*c3))/((a3*b5)-(a5*b3));
                    var y35=((c3-(b3*x35))/a3);
                    var x36=((a3*c6)-(a6*c3))/((a3*b6)-(a6*b3));
                    var y36=((c3-(b3*x36))/a3);
                }

                if (a4==0)
                {
                    var x45=((a5*c4)-(a4*c5))/((a5*b4)-(a4*b5));
                    var y45=((c5-(b5*x45))/a5);
                    var x46=((a6*c4)-(a4*c6))/((a6*b4)-(a4*b6));
                    var y46=((c6-(b6*x46))/a6);
                }
                else
                {
                    var x45=((a4*c5)-(a5*c4))/((a4*b5)-(a5*b4));
                    var y45=((c4-(b4*x45))/a4);
                    var x46=((a4*c6)-(a6*c4))/((a4*b6)-(a6*b4));
                    var y46=((c4-(b4*x46))/a4);
                }

                if(a5==0)
                {
                    var x56=((a6*c5)-(a5*c6))/((a6*b5)-(a5*b6));
                    var y56=((c6-(b6*x56))/a6);
                }
                else
                {
                    var x56=((a5*c6)-(a6*c5))/((a5*b6)-(a6*b5));
                    var y56=((c5-(b5*x56))/a5);
                }

                if(a3==0&&a6==0)
                {
                    var x36=0;
                    var y36=0;
                }

                form.x12.value=x12;
                form.y12.value=y12;

                form.x13.value=x13;
                form.y13.value=y13;

                form.x14.value=x14;
                form.y14.value=y14;

                form.x15.value=x15;
                form.y15.value=y15;

                form.x16.value=x16;
                form.y16.value=y16;



                form.x23.value=x23;
                form.y23.value=y23;

                form.x24.value=x24;
                form.y24.value=y24;

                form.x25.value=x25;
                form.y25.value=y25;

                form.x26.value=x26;
                form.y26.value=y26;

                form.x34.value=x34;
                form.y34.value=y34;

                form.x35.value=x35;
                form.y35.value=y35;

                form.x36.value=x36;
                form.y36.value=y36;


                form.x45.value=x45;
                form.y45.value=y45;

                form.x46.value=x46;
                form.y46.value=y46;

                form.x56.value=x56;
                form.y56.value=y56;

                var x1x=parseFloat(form.x1x.value);
                var y1y=parseFloat(form.y1y.value);
                var x2x=parseFloat(form.x2x.value);
                var y2y=parseFloat(form.y2y.value);
                var x3x=parseFloat(form.x3x.value);
                var y3y=parseFloat(form.y3y.value);
                var x4x=parseFloat(form.x4x.value);
                var y4y=parseFloat(form.y4y.value);
                var x4x=parseFloat(form.x4x.value);
                var y4y=parseFloat(form.y4y.value);
                var x5x=parseFloat(form.x5x.value);
                var y5y=parseFloat(form.y5y.value);
                var x6x=parseFloat(form.x6x.value);
                var y6y=parseFloat(form.y6y.value);

                var factibles = new Array();

                factibles[0] = new Object()
                factibles[0].Y = x12;
                factibles[0].X = y12;
                factibles[0].factible = 1;

                factibles[1] = new Object()
                factibles[1].Y = x13;
                factibles[1].X = y13;
                factibles[1].factible = 1;
				
                factibles[2] = new Object()
                factibles[2].Y = x14;
                factibles[2].X = y14;
                factibles[2].factible = 1;
				
                factibles[3] = new Object()
                factibles[3].Y = x15;
                factibles[3].X = y15;
                factibles[3].factible = 1;
				
                factibles[4] = new Object()
                factibles[4].Y = x16;;
                factibles[4].X = y16;
                factibles[4].factible = 1;	
				
                factibles[5] = new Object()
                factibles[5].Y = x1x;
                factibles[5].X = y1y;
                factibles[5].factible = 1;
				
                factibles[6] = new Object()
                factibles[6].Y = x23;
                factibles[6].X = y23;
                factibles[6].factible = 1;
				
                factibles[7] = new Object()
                factibles[7].Y = x24;
                factibles[7].X = y24;
                factibles[7].factible = 1;
				
                factibles[8] = new Object()
                factibles[8].Y = x25;;
                factibles[8].X = y25;
                factibles[8].factible = 1;
				
                factibles[9] = new Object()
                factibles[9].Y = x26;
                factibles[9].X = y26;
                factibles[9].factible = 1;				
				
                factibles[10] = new Object()
                factibles[10].Y = x2x;
                factibles[10].X = y2y;
                factibles[10].factible = 1;
				
				
                factibles[11] = new Object()
                factibles[11].Y = x34;
                factibles[11].X = y34;
                factibles[11].factible = 1;
				
                factibles[12] = new Object()
                factibles[12].Y = x35;
                factibles[12].X = y35;
                factibles[12].factible = 1;
				
                factibles[13] = new Object()
                factibles[13].Y = x36;
                factibles[13].X = y36;
                factibles[13].factible = 1;
				
                factibles[14] = new Object()
                factibles[14].Y = y3y;
                factibles[14].Y = x3x;
                factibles[14].factible = 1;		
				
                factibles[15] = new Object()
                factibles[15].Y = x45;
                factibles[15].X = y45;
                factibles[15].factible = 1;
				
                factibles[16] = new Object()
                factibles[16].Y = x46;
                factibles[16].X = y46;
                factibles[16].factible = 1;	
				
                factibles[17] = new Object()
                factibles[17].Y = x4x;
                factibles[17].X = y4y;
                factibles[17].factible = 1;			
				
                factibles[18] = new Object()
                factibles[18].Y = x56;
                factibles[18].X = y56;
                factibles[18].factible = 1;
					
                factibles[19] = new Object()
                factibles[19].Y = x5x;
                factibles[19].X = y5y;
                factibles[19].factible = 1;	
				
				
                var smin=0;
                var smini=0;			
				
                for(var x=0;x<factibles.length;x++)
                {
                    var r1=(a1*factibles[x].X)+(b1*factibles[x].Y)
                    var r2=(a2*factibles[x].X)+(b2*factibles[x].Y);
                    var r3=(a3*factibles[x].X)+(b3*factibles[x].Y);
                    var m4=(a4*factibles[x].X)+(b4*factibles[x].Y);	
                    var m5=(a5*factibles[x].X)+(b5*factibles[x].Y);
                    var m6=(a6*factibles[x].X)+(b6*factibles[x].Y);
	
                    //alert(r1+ ' ' +r2 + ' ' + r3 + ' '+ m4 + ' ' + m5 + ' ' + m6);
	
	
                    if((r1<=c1)&&(r2<=c2)&&(r3<=c3)&&(m4>=c4)&&(m5>=c5-1)&&(m6<=c6))
                    {
                        factibles[x].factible=2;
	
                    }
	
	
                }
                var nfactibles=0;
                for(var i=0;i<factibles.length;i++)
                {

                    facline.beginPath();
                    facline.fillStyle = '#cc0000';
                    if(factibles[i].factible==2)
                    {
                        nfactibles++;
	
                        var s1=(a4*(factibles[i].X))+(b4*(factibles[i].Y));
                        var s2=(a5*factibles[i].X)+(b5*factibles[i].Y);
                        var s3=(a6*factibles[i].X)+(b6*factibles[i].Y);
	
                        factibles[i].d1p=Math.abs(c4-s1);

                        factibles[i].d2p=Math.abs(c5-s2);
                        factibles[i].d3n=Math.abs(c6-s3);

                        if(factibles[i].d1p>=0)
                        {	
                            factibles[i].d1n=0;
	
                        }
	

                        if(factibles[i].d2p>=0)
                        {	
                            factibles[i].d2n=0;
                        }
	

                        if(factibles[i].d3n>=0)
                        {	
                            factibles[i].d3p=0;
                        }
	
                        factibles[i].sum=factibles[i].d1n+factibles[i].d2n+factibles[i].d3n;  
	
                        if(nfactibles==1)
                        {
                            smin=factibles[i].sum;
                            smini=i;	
                        }
                        if(factibles[i].sum<smin)
                        {
                            smin=factibles[i].sum;
                            smini=i;	
                        }
		
	
                        facline.fillRect((factibles[i].X)+50, 500-(factibles[i].Y), 5, 5);
                        var z=(a4*factibles[i].X)+(b4*factibles[i].Y);	
                        alert( '        Soluci�n Factible \n  '+' \n x   =' +factibles[i].X + ' y  =' + factibles[i].Y +'\nz  =' +z +'\nd1n  =' + factibles[i].d1n  +'\nd2n =' + factibles[i].d2n + '\nd3n  =' + factibles[i].d3n+'\nsum  =' + factibles[i].sum );   
                        //alert(' x   =' +factibles[i].X + ' y  =' + factibles[i].Y +'\nz  =' +z +'\nd1n  =' + factibles[i].d1n +'   d1p  =' + factibles[i].d1p +'\nd2n =' + factibles[i].d2n +'     d2p  =' + factibles[i].d2p+ '\nd3n  =' + factibles[i].d3n+'    d3p  =' + factibles[i].d3p+'\nsum  =' + factibles[i].sum);
                    }


                }
                alert('\n        Solucion Optima\n'+' \n x   =' +factibles[smini].X + ' y  =' + factibles[smini].Y +'\nd1n  =' + factibles[smini].d1n  +'   d2n =' + factibles[smini].d2n + '   d3n  =' + factibles[smini].d3n);
	
	
            }				
            function factible(form) {

                var a1=parseFloat(form.a1.value);
                var b1=parseFloat(form.b1.value);
                var c1=parseFloat(form.c1.value);
                var a2=parseFloat(form.a2.value);
                var b2=parseFloat(form.b2.value);
                var c2=parseFloat(form.c2.value);
                var a3=parseFloat(form.a3.value);
                var b3=parseFloat(form.b3.value);
                var c3=parseFloat(form.c3.value);
                var a4=parseFloat(form.a4.value);
                var b4=parseFloat(form.b4.value);
                var c4=parseFloat(form.c4.value);
                var a5=parseFloat(form.a5.value);
                var b5=parseFloat(form.b5.value);
                var c5=parseFloat(form.c5.value);
                var a6=parseFloat(form.a6.value);
                var b6=parseFloat(form.b6.value);
                var c6=parseFloat(form.c6.value);
                var horizontal;


                function cargaContextoCanvas(idCanvas){
                    var elemento = document.getElementById(idCanvas);
                    if(elemento && elemento.getContext){
                        var contexto = elemento.getContext('2d');
                        if(contexto){
                            return contexto;
                        }
                    }
                    return false;
                }
                var linea1 = cargaContextoCanvas('grafica');
                if(linea1)
                {
                    linea1.beginPath();
                    //Primero vamos a pintar los ejes:
                    //Primero ponemos el color en rojo: 
                    linea1.fillStyle = '#000000';
                    //Eje de las X: 

                    for(i=0;i<501;i++)
                    {
                        linea1.fillStyle = '#FFFF00'
                        linea1.fillRect((-i*(b1/a1))+50+(c1/a1)-600, 500-i, 600, 2);
                        linea1.fillStyle = '#0000F8';
                        linea1.fillRect((-i*(b2/a2))+50+(c2/a2), 500-i, 1, 550);
                        linea1.fillStyle = '#993300';
                        linea1.fillRect((-i*(b3/a3))+50+(c3/a3), 500-i, 1, 200);

                    }

                    if (a1==0)
                    {
                        horizontal=c1/b1;
                        linea1.fillStyle = '#FFFF00';
                        linea1.fillRect(50, 500-horizontal, 600, 50);
                    }

                    if (a2==0)
                    {
                        horizontal=c2/b2;
                        linea1.fillStyle = '#0000F8';
                        linea1.fillRect(50, 500-horizontal, 600, 50);
                    }

                    if (a3==0)
                    {
                        horizontal=c3/b3;
                        linea1.fillStyle = '#993300';
                        linea1.fillRect(50, 500-horizontal, 600, 5);
                    }


                }
                linea1.fillStyle = '#cc0000';
                //Eje de las X: 
                linea1.fillRect(50, 500, 600, 1);
                //Eje de las Y: 
                linea1.fillRect(50, 0, 1, 500);

            }

        </script>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <meta name="generator" content="Bluefish 2.0.2" >
        <style>
            <!-- 
            BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
            -->
        </style>
        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>
        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>
        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>

        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>




        <style>
            body {
                margin: 0px;
                padding: 0px;
            }

            #myCanvas {
                border: 1px solid #9C9898;
            }
        </style>
        <style>
            <!-- 
            BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"Arial"; font-size:x-small }
            -->
        </style></head>

    <body onmousedown="return false;">
        <form name="form">


            <br>

            <table style="text-align: left; width: 920px;" border="0" cellpadding="2" cellspacing="2">

                <tbody>
                    <tr>
                        <td style="vertical-align: top; width: 910px;"> <big> </big><big>
                </big><big> </big><big> </big><big> </big><big> </big>
                <table style="text-align: top; width: 750px; height: 244px; font-weight: bold;" border="0" cellpadding="2" cellspacing="2">
                    <tbody>
                        <tr>
                            <td style="vertical-align: left;"><canvas id="grafica" width="701" height="601"><big>HTML 5 </big></canvas></td>
                        </tr>
                    </tbody>
                </table>

                <br>
                <br>
                <div style="text-align: center;"><br style="font-weight: bold;">
                </div>
                <big> <span style="font-weight: bold;"><br>
                    </span></big>
                <div style="text-align: center;"><big><span style="font-weight: bold;"></span></big><br>
                    <table style="text-align: left; width: 500px;" border="1" cellpadding="2" cellspacing="2">
                        <tbody>
                            <tr>
                                <td style="vertical-align: top; width: 437px;"><br>
                                    <table style="text-align: left; height: 221px; width: 500px;" border="1" cellpadding="2" cellspacing="2">
                                        <tbody>
                                            <tr>
                                                <td style="vertical-align: top;"><br>
                                                </td>
                                                <td style="vertical-align: top; text-align: center; width: 57px;">x1<br>
                                                    Producto 1<br>
                                                </td>
                                                <td style="vertical-align: top; text-align: center; width: 79px;">x2<br>
                                                    Producto 2<br>
                                                </td>
                                                <td style="vertical-align: top; width: 27px;">
                                                    <br>
                                                    <br>
                                                </td>
                                                <td style="vertical-align: top; width: 49px;">
                                                    ci<br>
                                                </td>
                                                <td style="vertical-align: top; width: 78px;"><br>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px; text-align: center;">Restricciones
                                                    <br>
                                                    de <br>
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input onfocus="true" name="a1" size="1" onclick="document.forms['form'].elements['a1'].focus()"></td>
                                                <td style="vertical-align: top; width: 79px; text-align: center;"><input name="b1" size="1" onclick="document.forms['form'].elements['b1'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">=<br>
                                                </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c1" size="1" onclick="document.forms['form'].elements['c1'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px; text-align: center; font-style: italic;"><small>Disponibilidad
                                                        Materia Prima  <br> 1
                                                    </small></td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px; text-align: center;">Recursos
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input name="a2" size="1" onclick="document.forms['form'].elements['a2'].focus()"></td>
                                                <td style="vertical-align: top; width: 79px; text-align: center;"><input name="b2" size="1" onclick="document.forms['form'].elements['b2'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">= </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c2" size="1" onclick="document.forms['form'].elements['c2'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px; text-align: center; font-style: italic;"><small>Disponibilidad
                                                        Materia Prima 2  </small></td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px;"><br>
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input name="a3" size="1" onclick="document.forms['form'].elements['a3'].focus()"></td>
                                                <td style="vertical-align: top; width: 79px; text-align: center;"><input name="b3" size="1" onclick="document.forms['form'].elements['b3'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">= </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c3" size="1" onclick="document.forms['form'].elements['c3'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px; text-align: center; font-style: italic;"><small>Disponibilidad
                                                        Materia Prima3 </small></td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px; text-align: center;">Restricciones<br>
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input name="a4" size="1" onclick="document.forms['form'].elements['a4'].focus()"></td>
                                                <td style="vertical-align: top; width: 79px; text-align: center;"><input name="b4" size="1" onclick="document.forms['form'].elements['b4'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">=<br>
                                                </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c4" size="1" onclick="document.forms['form'].elements['c4'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px; text-align: center;"><small><span style="font-style: italic;">Meta 1 : Ganancias</span><br>
                                                    </small></td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px; text-align: center;">de<br>
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input name="a5" size="1" onclick="document.forms['form'].elements['a5'].focus()"></td>
                                                <td style="vertical-align: top; width: 79px; text-align: center;"><input name="b5" size="1" onclick="document.forms['form'].elements['b5'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">=<br>
                                                </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c5" size="1" onclick="document.forms['form'].elements['c5'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px; text-align: center;"><small><span style="font-style: italic;">Meta 2: Producci&oacute;n Lineal</span><br>
                                                    </small></td>
                                            </tr>
                                            <tr>
                                                <td style="vertical-align: top; width: 87px; text-align: center;">Metas<br>
                                                </td>
                                                <td style="vertical-align: top; width: 57px; text-align: center;"><input name="a6" size="1" onclick="document.forms['form'].elements['a6'].focus()"></td>
                                                <td style="vertical-align: top; text-align: center; width: 79px;"><input name="b6" size="1" onclick="document.forms['form'].elements['b6'].focus()"></td>
                                                <td style="vertical-align: top; width: 27px; text-align: center;">=<br>
                                                </td>
                                                <td style="vertical-align: top; width: 49px; text-align: center;"><input name="c6" size="1" onclick="document.forms['form'].elements['c6'].focus()"></td>
                                                <td style="vertical-align: top; width: 78px;">
                                                    <div style="text-align: center;"><small><span style="font-style: italic;">Meta 3: Producci&oacute;n minima</span></small></div>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                                <td style="vertical-align: top; width: 210px;"><br>
                                    <br>
                                    <div style="text-align: center;">
                                    </div>
                                    <div style="text-align: left;">
                                        <div style="text-align: center;"><input name="Modelar " value="1.       Modelar Problema" onclick="modelar(this.form)" type="button"> <br>
                                            <br>
                                            <input name="pintar" value="2.     Programar Problema" onclick="graficar(this.form)" type="button"><br>

                                            <br>

                                            <input name="Modelar " value="3.       Modelar Metas           " onclick="modelarmetas(this.form)" type="button"><br>
                                            <br>

                                            <input name="pintar" value="4.   Programar por Metas" onclick="metas(this.form)" type="button"><br>
                                        </div>

                                        <br style="font-weight: bold; text-decoration: underline;">
                                        <br style="font-weight: bold; text-decoration: underline;">
                                        <div style="text-align: center; text-decoration: underline;">
                                            <input style="font-weight: bold;" name="hallar" value="     Solver Problema" onclick="puntointerseccion(this.form)" type="button"> <br style="font-weight: bold;">
                                        </div>

                                        <br style="font-weight: bold; text-decoration: underline;">
                                        <br>
                                        <div style="text-align: center;">
                                            <input name="pintar" value="Desviaciones" onclick="showFillText();return true;" type="button"><br>

                                            <br>

                                            <input name="pintar" value="Region Factible" onclick="factible(this.form)" type="button"><br>

                                            <br>
                                        </div>

                                        <br>
                                        <br>
                                        <br>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <big><span style="font-weight: bold;"></span></big></div>
                <big><span style="font-weight: bold;"><br>
                        <br>
                        Caso de Estudio:</span></big><br>
                <br>
                <big style="font-weight: bold;">Modelo de Producci&oacute;n</big><br>
                <br>
                <table style="text-align: left; width: 767px; height: 195px;" border="1" cellpadding="2" cellspacing="2">
                    <tbody>
                        <tr>
                            <td style="vertical-align: top; text-align: center;">
                                Producci&oacute;n <br>
                            </td>
                            <td style="vertical-align: top; text-align: center; width: 95px;">Materia
                                Prima <br />1</td>
                            <td style="vertical-align: top; text-align: center; width: 22px;"><br>
                            </td>
                            <td style="vertical-align: top; text-align: center; width: 112px;">
                                <div style="text-align: center;">Materia
                                    Prima<br>
                                </div>
                                2<br>
                            </td>
                            <td style="vertical-align: top; text-align: center;"><br>
                            </td>
                            <td style="vertical-align: top; width: 112px; text-align: center;">Materia
                                Prima<br>
                                3<br>
                            </td>
                            <td style="vertical-align: top; width: 124px; text-align: center;">Ganancia</td>
                        </tr>
                        <tr style="width: 512px;">
                            <td style="vertical-align: top; width: 124px; text-align: center;">Producto
                                1 =  <br>
                            </td>
                            <td style="vertical-align: top; width: 95px;">
                                <div style="text-align: center;"><input name="p1mp1" size="7" value="0.35 " onclick="document.forms['form'].elements['p1mp1'].focus()"> </div>
                                <br>
                            </td>
                            <td style="vertical-align: top; width: 22px; text-align: center;">+<br>
                            </td>
                            <td style="vertical-align: top; width: 112px;">
                                <div style="text-align: center;"><input name="p1mp2" size="10" value="0.15" onclick="document.forms['form'].elements['p1mp2'].focus()"> </div>
                                <br>
                            </td>
                            <td style="vertical-align: top; width: 29px;">
                                + </td>
                            <td style="vertical-align: top; width: 112px;">
                                <div style="text-align: center;"><input name="p1mp3" size="10" value="0" onclick="document.forms['form'].elements['p1mp3'].focus()"> </div>
                                <br>
                            </td>
                            <td style="vertical-align: top; width: 124px; text-align: center;"><input name="g1" size="7" value="0.4" onclick="document.forms['form'].elements['g1'].focus()"></td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top; text-align: center; width: 124px;">Producto
                                2 = <br>
                            </td>
                            <td style="vertical-align: top; width: 95px; text-align: center;"><input name="p2mp1" size="7" value="0" onclick="document.forms['form'].elements['p2mp1'].focus()"></td>
                            <td style="vertical-align: top; width: 22px; text-align: center;">+<br>
                            </td>
                            <td style="vertical-align: top; width: 112px; text-align: center;"><input name="p2mp2" size="10" value="0.25" onclick="document.forms['form'].elements['p2mp2'].focus()"></td>
                            <td style="vertical-align: top; width: 29px; text-align: center;">+<br>
                            </td>
                            <td style="vertical-align: top; width: 112px;">
                                <div style="text-align: center;"><input name="p2mp3" size="10" value="0.25" onclick="document.forms['form'].elements['p2mp3'].focus()"> </div>
                                <br>
                            </td>
                            <td style="vertical-align: top; width: 124px; text-align: center;"><input name="g2" size="7" value="0.6" onclick="document.forms['form'].elements['g2'].focus()"></td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top; width: 124px; text-align: center"><br>
                                Disponibilidad: <br>
                                <br>
                            </td>
                            <td style="vertical-align: top; width: 95px; text-align: center;"><br>
                                <input name="dispmp1" size="7" value="210" onclick="document.forms['form'].elements['dispmp1'].focus()"><br>
                            </td>
                            <td style="vertical-align: top; width: 22px; text-align: center;"><br>
                            </td>
                            <td style="vertical-align: top; width: 112px; text-align: center;"><br>
                                <input name="dispmp2" size="10" value="115" onclick="document.forms['form'].elements['dispmp2'].focus()"><br>
                            </td>
                            <td style="vertical-align: top; width: 29px; text-align: center;"> <br>
                            </td>
                            <td style="vertical-align: top; width: 112px; text-align: center;"><br>
                                <input name="dispmp3" size="10" value="100" onclick="document.forms['form'].elements['dispmp3'].focus()"><br>
                            </td>
                            <td style="vertical-align: top; width: 124px;"><br>
                                <br>
                            </td>
                        </tr>
                        <tr>
                            <td style="vertical-align: top;"><br>
                            </td>
                            <td style="vertical-align: top;"><span style="background-color: rgb(0, 0, 102);"><span style="background-color: yellow;">
                                    </span></span><br>
                            </td>
                            <td style="vertical-align: top;"><br>
                            </td>
                            <td style="vertical-align: top;"><span style="background-color: rgb(51, 102, 255);"><span style="background-color: rgb(0, 0, 248);"></span><span style="background-color: rgb(51, 102, 255);"><span style="background-color: rgb(0, 0, 248);"></span> </span></span><br>
                            </td>
                            <td style="vertical-align: top;"><br>
                            </td>
                            <td style="vertical-align: top;"><span style="background-color: rgb(102, 102, 204);"></span><span style="background-color: rgb(153, 51, 0);">  

                                </span><br>
                            </td>
                            <td style="vertical-align: top;"><input name="Modelar " value="Modelar Problema" onclick="modelar(this.form)" type="button">
                            </td>
                        </tr>
                    </tbody>
                </table>
                <br>
                <br>
                <br />
                <span style="text-align: left; font-weight: bold;"> <big> Decisor: <br /><br />Identificaci&oacute;n de Metas</big></span><br /><br />        
                <table style="text-align: left; width: 763px; height: 221px;" border="1" cellpadding="2" cellspacing="2">
                    <tbody>
                        <tr>
                            <td style="border: 0px"><br></td> 
                        </tr>
                        <tr>
                    <div style="font-size: 20px">
                        <td style="border: 0px">
                            Metas por orden de prioridad: 
                        </td> 
                        <td style="border: 0px"></td>
                        <td style="border: 0px">Preferencia: w [0-100]</td>  
                        <td style="border: 0px"></td>
                    </div> 
                    </tr> 
                    <tr>
                        <td><big><span style="font-weight: bold;">Meta 1: </span></big>&nbsp;<span style="background-color: red;"> &nbsp; &nbsp; &nbsp;</span></td>  
                    <td>Ganancias M&iacute;nimas = <input name="gmin" size="7" value="240" onclick="document.forms['form'].elements['gmin'].focus()">  </td>   
                    <td><input name="Modelar " value="Actualizar Meta 1" onclick="meta1(this.form)" type="button">     </td>   
                    <td>w1= <input name="w1" size="1" value="1" onclick="document.forms['form'].elements['w1'].focus()">  </td>   
                    </tr>    

                    <tr>
                        <td> <big><span style="font-weight: bold;"> Meta 2: </span></big>&nbsp;<span style="background-color: rgb(255, 153, 0);"> &nbsp; &nbsp; &nbsp;</span></td>   
                    <td>Linealidad de la Produccion: La Cantidad de productos 1 = <input name="cantidad2" size="1" value="2" onclick="document.forms['form'].elements['cantidad2'].focus()"> productos 2.</td>   
                    <td><input name="Modelar " value="Actualizar Meta 2" onclick="meta2(this.form)" type="button"></td>   
                    <td> w2= <input name="w2" size="1" value="1" onclick="document.forms['form'].elements['w2'].focus()"></td>   
                    </tr>    

                    <tr> 
                        <td> <big><span style="font-weight: bold;">Meta 3: </span></big>&nbsp;<span style="background-color: rgb(51, 204, 0);"> &nbsp; &nbsp; &nbsp;</span></td>     
                    <td>Cantidad m&iacute;nima de producci&oacute;n del producto 2 Produccion2_min= <input name="p2min" size="7" value="300" onclick="document.forms['form'].elements['p2min'].focus()"></td>
                    <td>       <input name="Modelar " value="Actualizar Meta 3" onclick="meta3(this.form)" type="button"></td>
                    <td>w3= <input name="w3" size="1" value="1" onclick="document.forms['form'].elements['w3'].focus()"></td>   
                    </tr>
                    </tbody>
                </table>
                <br>
                <br>
                <br>

                <!--Soluciones factibles -->
                <big><span style="font-weight: bold;">Conjunto de
                        Soluciones Factibles</span></big>:<br>
                <br>
                <br>
                <table style="width: 700px;" border="0" cellpadding="2" cellspacing="2">
                    <tr>
                        <td> 
                            <table cellspacing="10" cellpadding="10" border="1"> 
                                <tr> 
                                    <td align="center">12:</td> 
                                    <td align="center"> 
                                        <table cellspacing="2" cellpadding="2" border="1"> 
                                            <tr> 
                                                <td><input style=" border: 0" name="y12" size="4" value="0"></td> 
                                                <td><input style=" border: 0" name="x12" size="4" value="0"></td> 
                                            </tr> 
                                        </table> 
                                    </td> 
                                </tr>
                                <tr>
                                    <td align="center">13:</td> 
                                    <td align="center"> 
                                        <table cellspacing="2" cellpadding="2" border="1"> 
                                            <tr> 
                                                <td><input style=" border: 0" name="y13" size="4" value="0"></td> 
                                                <td><input style=" border: 0" name="x13" size="4" value="0"></td> 
                                            </tr> 
                                        </table> 
                                    </td> 

                                </tr> 

                                <tr>
                                    <td align="center">14:</td> 
                                    <td align="center"> 
                                        <table cellspacing="2" cellpadding="2" border="1"> 
                                            <tr> 
                                                <td><input style=" border: 0" name="y14" size="4" value="0"></td> 
                                                <td><input style=" border: 0" name="x14" size="4" value="0"></td> 
                                            </tr> 
                                        </table> 
                                    </td> 

                                </tr> 
                                <tr>
                                    <td align="center">15:</td> 
                                    <td align="center"> 
                                        <table cellspacing="2" cellpadding="2" border="1"> 
                                            <tr> 
                                                <td><input style=" border: 0" name="y15" size="4" value="0"></td> 
                                                <td><input style=" border: 0" name="x15" size="4" value="0"></td> 
                                            </tr> 
                                        </table> 
                                    </td> 
                                </tr> 

                                <tr>
                                    <td align="center">16:</td> 
                                    <td align="center"> 
                                        <table cellspacing="2" cellpadding="2" border="1"> 
                                            <tr> 
                                                <td><input style=" border: 0" name="y16" size="4" value="0"></td> 
                                                <td><input style=" border: 0" name="x16" size="4" value="0"></td> 
                                            </tr> 
                                            <tr>
                                                <td><big><big>(</big></big><input name="x1x" size="4" value="0"> <big><big>,0)</big></big></td>                                    
                                    <td><big><big>( 0,</big></big> <input name="y1y" size="4" value="0"><big><big>)</big></big></td>
                    </tr>
                </table> 
                </tr> 

            </table>
        </td>
        <td>
            <table cellspacing="10" cellpadding="10" border="1"> 
                <tr> 
                    <td align="center">23:</td> 
                    <td align="center"> 
                        <table cellspacing="2" cellpadding="2" border="1"> 
                            <tr> 
                                <td><input style=" border: 0" name="y23" size="4" value="0"></td> 
                                <td><input style=" border: 0" name="x23" size="4" value="0"></td> 
                            </tr> 
                        </table> 
                    </td> 
                </tr>
                <tr>
                    <td align="center">24:</td> 
                    <td align="center"> 
                        <table cellspacing="2" cellpadding="2" border="1"> 
                            <tr> 
                                <td><input style=" border: 0" name="y24" size="4" value="0"></td> 
                                <td><input style=" border: 0" name="x24" size="4" value="0"></td> 
                            </tr> 
                        </table> 
                    </td> 

                </tr> 

                <tr>
                    <td align="center">25:</td> 
                    <td align="center"> 
                        <table cellspacing="2" cellpadding="2" border="1"> 
                            <tr> 
                                <td><input style=" border: 0" name="y25" size="4" value="0"></td> 
                                <td><input style=" border: 0" name="x25" size="4" value="0"></td> 
                            </tr> 
                        </table> 
                    </td> 

                </tr> 
                <tr>
                    <td align="center">26:</td> 
                    <td align="center"> 
                        <table cellspacing="2" cellpadding="2" border="1"> 
                            <tr> 
                                <td><input style=" border: 0" name="y16" size="4" value="0"></td> 
                                <td><input style=" border: 0" name="x16" size="4" value="0"></td> 
                            </tr> 
                            <tr>
                                <td><big><big>(</big></big><input name="x2x" size="4" value="0"><big><big> , 0</big></big> <big><big>) </big></big></td>
                    <td><big><big>( 0, <input name="y2y" size="5" value="0">)</big></big></td>
    </tr>
</table> 
</td>
</tr> 
<tr>
    <td align="center">34:</td> 
    <td align="center"> 
        <table cellspacing="2" cellpadding="2" border="1"> 
            <tr> 
                <td><input style=" border: 0" name="y34" size="4" value="0"></td> 
                <td><input style=" border: 0" name="x34" size="4" value="0"></td> 
            </tr> 

        </table> 
    </td>
</tr> 

</table>
</td>
</tr>
<br />
<br />
<tr>
    <td> 

        <table cellspacing="10" cellpadding="10" border="1"> 
            <tr> 
                <td align="center">35:</td> 
                <td align="center"> 
                    <table cellspacing="2" cellpadding="2" border="1"> 
                        <tr> 
                            <td><input style=" border: 0" name="y35" size="4" value="0"></td> 
                            <td><input style=" border: 0" name="x35" size="4" value="0"></td> 
                        </tr> 
                    </table> 
                </td> 
            </tr>
            <tr>
                <td align="center">36:</td> 
                <td align="center"> 
                    <table cellspacing="2" cellpadding="2" border="1"> 
                        <tr> 
                            <td><input style=" border: 0" name="y36" size="4" value="0"></td> 
                            <td><input style=" border: 0" name="x36" size="4" value="0"></td> 
                        </tr> 
                        <tr>
                            <td>
                        <big><big>(<input name="x3x" size="4" value="0">,0 )</big></big>
                </td>    
                <td>
            <big><big>(0,<input name="y3y" size="4" value="0"> )</big></big>       
    </td>
</tr>
</table> 
</td> 

</tr> 

<tr>
    <td align="center">45:</td> 
    <td align="center"> 
        <table cellspacing="2" cellpadding="2" border="1"> 
            <tr> 
                <td><input style=" border: 0" name="y45" size="4" value="0"></td> 
                <td><input style=" border: 0" name="x45" size="4" value="0"></td> 
            </tr> 
        </table> 
    </td> 

</tr> 
<tr>
    <td align="center">46:</td> 
    <td align="center"> 
        <table cellspacing="2" cellpadding="2" border="1"> 
            <tr> 
                <td><input style=" border: 0" name="y46" size="4" value="0"></td> 
                <td><input style=" border: 0" name="x46" size="4" value="0"></td> 
            </tr> 
            <tr> 
                <td><big><big>(<input name="x4x" size="4" value="0">,0 )</big></big></td>
    <td><big><big>(0,<input name="y4y" size="4" value="0">)</big></big></td>
</tr> 
</table> 
</td> 
</tr> 

<tr>
    <td align="center">56:</td> 
    <td align="center"> 
        <table cellspacing="2" cellpadding="2" border="1"> 
            <tr> 
                <td><input style=" border: 0" name="y56" size="4" value="0"></td> 
                <td><input style=" border: 0" name="x56" size="4" value="0"></td> 
            </tr> 
        </table> 
</tr> 

</table>
</td>

<td>
    <table cellspacing="10" cellpadding="10" border="1"> 
        <tr> 
            <td align="center">5:</td> 
            <td align="center"> 
                <table cellspacing="2" cellpadding="2" border="1"> 
                    <tr> 
                        <td><big><big>(<input name="x5x" size="4" value="0">,0 )</big></big></td> 
            <td><big><big>(0,<input name="y5y" size="4" value="0">)</big></big></td> 
</tr> 
</table> 
</td> 
</tr>
<tr>
    <td align="center">6:</td> 
    <td align="center"> 
        <table cellspacing="2" cellpadding="2" border="1"> 
            <tr> 
                <td><big><big>(<input name="x6x" size="4" value="0">,0 )</big></big></td> 
    <td><big><big>(0,<input name="y6y" size="4" value="0">)</big></big></td> 
</tr> 
</table> 
</td> 

</tr> 

</table>
</td>

</tr>

</table>

<br>
<br />
<br />
<big style="font-weight: bold;"><big>Problema de Programaci&oacute;n por Metas Asociado<br>
        <br>
    </big></big>
<div style="text-align: center;"><br>

</div>

<!-- -->

<table style=" height: 282px; width: 815px;"  border="0" cellspacing="0" cols="11" frame="void" rules="none" >
    <colgroup><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"><col width="46"></colgroup>
    <tbody>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center" height="20" width="46"><b><font size="3">x1</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">x2</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y1+</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y1-</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y2+</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y2-</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y3+</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">y3-</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="center"  width="46"><b><font size="3">Z</font></b></td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left" width="46"><br>
            </td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">418,1818181818</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">209,0909090909</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">52,7272727273</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">90,9090909091</td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">90,9090909091</td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0); "align="left" height="17"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br> </td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br></td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left" height="17"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>

            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0); " align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left" height="17"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>

            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="left"><br>
            </td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">0,35</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">146,3636363636</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">210</td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);" align="right" height="17">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);" align="right">0,25</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">52,2727272727</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">100</td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">0,15</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0,25</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">115</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">115</td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">0,4</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0,6</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">-1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">240</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">240</td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">-2</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">-1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
        </tr>
        <tr>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right" height="17">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">0</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">-1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">1</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">300</td>
            <td style="border: 1px solid rgb(0, 0, 0);"  align="right">300</td>
        </tr>
        <tr>
            <td align="left" height="17"><br>
            </td>
            <td align="left"><br>
            </td>

            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
        </tr>
        <tr>
            <td align="left" height="17"><br>
            </td>
            <td align="left">Z=</td>

            <td align="left">
                <table border="0" cellspacing="0" cols="1" frame="void" rules="none">
                    <colgroup><col width="46"></colgroup>
                    <tbody>
                        <tr>
                            <td  align="right" height="17" width="46">292,7272727273</td>
                        </tr>
                    </tbody>
                </table>

            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br>
            </td>
            <td align="left"><br></td></tr></tbody>
</table>
<br>
<big style="font-weight: bold;"><big><br>
    </big></big>
<br>
<br>
</tr>
</tbody>
</table>
</form>
</body>
</html>